#include "CHealthBar.h"
#include "ParticleEngine.h"
#include "CCamera.h"

CHealthBar::~CHealthBar()
{
	if(m_nParticleID != NULL)
		ParticleEngine::GetInstance()->RemoveEffect(m_nParticleID);
}

void CHealthBar::Update(float fElapsedTime)
{
	ParticleEngine::GetInstance()->SetEmitterInfo(*m_nParticleID, GetPosX()+CCamera::GetInstance()->GetCameraPosX(), GetPosY()+CCamera::GetInstance()->GetCameraPosY(), 0);
}

void CHealthBar::Render()
{
}
void CHealthBar::SetType(int type)
{
	if(type == 0)
		m_nParticleID = ParticleEngine::GetInstance()->AddEffect(4, 75, 68, 48, true);
	else
		m_nParticleID = ParticleEngine::GetInstance()->AddEffect(5, 75, 68, 48, true);
}